import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Login from '@/components/Login'
import Register from '@/components/Register'
import Index from '@/components/Index'

//导入manager文件夹下的内容
import Manage from '@/manager/Manage'
import AddGoods from '@/manager/AddGoods'

Vue.use(Router)

export default new Router({
  mode:'history',
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/register',
      name: 'Register',
      component: Register
    },
    {
      path: '/index',
      name: 'Index',
      component: Index
    },
    {
      path: '/manage',
      name: 'Manage',
      component: Manage,
      children:[
        {
          path:'manage',
          component:() => import('@/manager/Manage')
        },
        {
          path:'add_cate',
          component:() => import('@/manager/AddCate')
        },
      ]
    },
    {
      path: '/addgoods',
      name: 'AddGoods',
      component: AddGoods
    },
  ]
})
